/*
 * Created on Jun 23, 2004
 */
package org.vectrics.recruiter.job;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.vectrics.batch.Batch;
import org.vectrics.domain.Domain;

/**
 * @author mmoore
 */
public class JobCandidateSkillMatchBatch extends Batch {
	private transient final Log log = LogFactory.getLog(this.getClass());
	//private int MAX_FAILURE_COUNT = 3;
	//private String background = "#eeeeff";
	private String BATCH_TYPE_CODE = "job.cand.skill.run";
	private String BATCH_DESCRIPTION = "Job Candidate Skill Match Run";
	private static boolean working = false;
	
	protected String getBatchTypeCode() {
		return(BATCH_TYPE_CODE);
	}
	/**
	 * 
	 */
	public JobCandidateSkillMatchBatch(Domain domain) {
		super(domain);
	}

	protected boolean persistRunResults() {
		return(true);
	}
	
	
	public String getDescription() {
		return(BATCH_DESCRIPTION);
	}
	
	protected boolean logOnlyErrors() {
		return(false);
	}

	protected boolean executeForEachDomain() {
		return(true);
	}

	/*
	 * 
	 */
	protected void execute(Domain domain) {
		log.debug("execute() called");
		working = true;
		if (Thread.currentThread() != null)
			Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
		findCandidateScores(domain);
	    processJobAgents(domain);
		working = false;
	}
	
	public boolean hasOtherRunningInstance() {
		return(working);
	}

	private void findCandidateScores(Domain domain) {
		
	}
	
	private void processJobAgents(Domain domain) {
	}
	
	
				
	
}
